/*
 * Powered By XY
 * Since 2020
 */

package com.xy.biz.fd.manager;

import java.util.Collection;
import java.util.List;

import com.xy.biz.fd.domain.bo.DocumentBO;
import com.xy.biz.fd.domain.bo.FolderBO;
import com.xy.biz.fd.domain.po.FolderPO;
import com.xy.biz.fd.domain.query.FolderQuery;
import com.xy.biz.fd.domain.req.folder.ListFolderRequest;

/**
 *
 *
 * @author ssl
 * @date 2021-1-23
 */
public interface FolderManager {

	/**
	 * 保存
	 *
	 * @param folderBO
	 */
	FolderBO saveFolder(FolderBO folderBO);

	/**
	 * 保存多个
	 *
	 * @param collection
	 */
	int saveAllFolder(Collection<FolderBO> collection);

	/**
	 * 更新
	 *
	 * @param folderBO
	 */
	int updateFolder(FolderBO folderBO);

	/**
	 * 批量更新
	 *
	 * @param folderBOS
	 */
	int updateFolderAll(Collection<FolderBO> folderBOS);

	/**
	 * 根据Id批量更新知识库id和ParentId
	 *
	 * @param folderBO
	 */
	int updateFolderByIds(FolderBO folderBO);

	/**
	 * 更新权限
	 *
	 * @param folderBO
	 */
	int updateFolderPermission(FolderBO folderBO);

	/**
	 * 删除
	 *
	 * @param folderId
	 */
	int deleteFolder(Long folderId);

	/**
	 * 批量删除
	 *
	 * @param folderIds
	 */
	int deleteFolders(Collection<Long> folderIds);

	/**
	 * 查找一个
	 *
	 * @param folderId
	 * @return
	 */
	FolderBO getFolder(Long folderId);

	/**
	 * 查找多个
	 *
	 * @param collection 标识集合
	 */
	List<FolderBO> listFolderById(Collection<Long> collection);

	/**
	 * 查找多个
	 *
	 * @param query 查找条件
	 */
	List<FolderBO> listFolder(FolderQuery query);

	/**
	 * 统计个数
	 *
	 * @param query 查找条件
	 */
	int countFolder(FolderQuery query);


	/**
	 * 修改多条文件夹通过父id
	 * @param folderBO
	 * @return
	 */
	int updateManyFolderByParentFolderId(FolderBO folderBO);


	/**
	 * 文件夹树状
	 * @param query
	 * @return
	 */
	List<FolderBO> listTreeFolderDocument(FolderQuery query);

	/**
	 * 根据文件夹名模糊查询文件夹
	 * @param folderBO 文件夹
	 * @return
	 */
	List<FolderBO> listFolderByName(FolderBO folderBO);

	FolderBO getFolderByNameAndRepository(ListFolderRequest build);
}
